
		<?php for($i=1;$i<=$data->quantity_object;$i++) {?>
		
		<?php 
			$at = $data->getAnswerThread1($data->ID,$i);
			$qt = $data->getQuestionThread($data->ID,$i);
		?>	
			<tr class="odd" >
		 							
				<?php	
					$question_status = $data->getStatus('question',$qt['ID'],'edit_status');					
					$resolve_status = $data->getStatus('answer', $at['ID'],'resolve_status');	
					$edit_status = $data->getStatus('answer',$at['ID'],'edit_status');				 
				?>
			<!-- PHẦN CÂU HỎI -->
			
   	  <td  style="width: 5%; text-align: center;">
   	  	<a href="<?php echo Yii::app()->baseUrl."/admin/issue/view/id/".$data->ID?>"><?php echo $data->ID?></a>
   	  </td>		
   	  
			<td  style="width: 10%; text-align: center;">
				<a href="<?php echo Yii::app()->baseUrl."/admin/question/view/id/".$at['ID']?>">Câu <?php echo $i?></a>
			</td>
			
			<td  style="width: 10%; text-align: center;"><?php echo $question_status?></td>	
		
			<td style="width: 15%; text-align: center;">
				<?php if($qt['editor']!=0){?>
					<?php echo User::model()->getUserName($qt['editor'])?>
				<?php } else {?>
					<?php 
						/*<?php echo CHtml::dropDownList('listEditor', '', $data->getUsers(7),array('id'=>'issue_'.$data->ID.'_'.$i))?>*/
						echo "---/---" 
					 ?>
				<?php }?>
			</td>	
			
			<!-- Action for checker to view/assign/reassign/assign to other/confirm -->
			<td >
				<div class="btn-group" >
					<button class="btn btn-info dropdown-toggle" data-toggle="dropdown">Chọn action<span class="caret"></span></button>
          	<ul class="dropdown-menu">
          		<li>
	            	<a 	href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/question/view/id/<?php echo $qt['ID']?>',800,600)" id="view_<?php echo $data->ID.'_'.$qt['thread_number']?>">
											<i class="icon-eye-open" ></i> Xem câu hỏi
								</a>
							</li>
          	<!-- Not assigned -->
          	<?php if($question_status=='NOTASSIGNED'){?>
          		<li>
	            	<a href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/question/assign/id/<?php echo $qt['ID']?>',800,600)" id="view_<?php echo $data->ID.'_'.$qt['thread_number']?>">
											<i class="icon-hand-right" ></i> Phân công cho editor
								</a>
							</li>
          	<!-- assigned -->
          	<?php } else if($question_status=='ASSIGNED'){?>
          	
          	<!-- edited -->
          	<?php } else if($question_status=='EDITED'){?>
	          	<li>		            
									<a id="confirm_<?php echo $data->ID.'_'.$i?>"  onclick="beforeAssign(<?php echo $qt['editor']?>,<?php echo $data->ID?>,<?php echo $i?>,'confirm')">
												<i class=" icon-thumbs-up" ></i> Xác nhận
									</a>
							</li>
							<li>
		            	<a id="reassign_<?php echo $data->ID.'_'.$i?>"  onclick="beforeAssign(<?php echo $qt['editor']?>,<?php echo $data->ID?>,<?php echo $i?>,'reassign')">
												<i class=" icon-thumbs-down" ></i> Yêu cầu soạn lại
									</a>
							</li>
							<li>
		            	<a href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/question/assignother/id/<?php echo $qt['ID']?>',800,600)" id="view_<?php echo $data->ID.'_'.$qt['thread_number']?>">
												<i class=" icon-hand-down" ></i> Phân công editor khác
									</a>
							</li>
          	<?php } else { ?>
          	
          	<?php }?>      	
            </ul>
        </div>		
			</td>
			
			<!-- PHẦN BÀI GIẢI -->
			
			<td style="width: 5%; text-align: center;">
				<a href="<?php echo Yii::app()->baseUrl."/admin/answer/view/id/".$at['ID']?>"><?php echo $at['ID']?></a>
			</td>
							
			<td style="width: 10%; text-align: center;"><?php echo $resolve_status?></td>		
			<td style="width: 10%; text-align: center;"><?php echo $edit_status?></td>	
			
			<td style="width: 15%; text-align: center;">
				<?php if($at['editor']!=0){?>
					<?php echo User::model()->getUserName($at['editor'])?>
				<?php } else {?>
					<?php 
						/*<?php echo CHtml::dropDownList('listEditor', '', $data->getUsers(7),array('id'=>'issue_'.$data->ID.'_'.$i,'class'=>'assignee'))?>*/
						echo "---/---" 
					 ?>
				<?php }?>
			</td>			
			

			<!-- Action for checker to view/assign/reassign/assign to other/confirm -->
			<td >
				<div class="btn-group" >
					<button class="btn btn-success dropdown-toggle" data-toggle="dropdown">Chọn action<span class="caret"></span></button>
          	<ul class="dropdown-menu">
          		<li>
	            	<a 	href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/answer/view/id/<?php echo $at['ID']?>',800,600)" id="view_<?php echo $data->ID.'_'.$at['thread_number']?>">
											<i class="icon-eye-open" ></i> Xem bài giải
								</a>
							</li>
          	<!-- Not assigned -->
          	<?php if($edit_status=='NOTASSIGNED'){?>
          		<li>
	            	<a href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/answer/assignEdit/id/<?php echo $at['ID']?>',800,600)" id="view_<?php echo $data->ID.'_'.$at['thread_number']?>">
											<i class="icon-hand-right" ></i> Phân công cho editor
								</a>
							</li>
          	<!-- assigned -->
          	<?php } else if($edit_status=='ASSIGNED'){?>
          	
          	<!-- edited -->
          	<?php } else if($edit_status=='EDITED'){?>
	          	<li>		            
									<a id="confirm_<?php echo $data->ID.'_'.$i?>"  onclick="beforeAssign(<?php echo $at['editor']?>,<?php echo $data->ID?>,<?php echo $i?>,'confirm')">
												<i class=" icon-thumbs-up" ></i> Xác nhận
									</a>
							</li>
							<li>
		            	<a id="reassign_<?php echo $data->ID.'_'.$i?>"  onclick="beforeAssign(<?php echo $at['editor']?>,<?php echo $data->ID?>,<?php echo $i?>,'reassign')">
												<i class=" icon-thumbs-down" ></i> Yêu cầu soạn lại
									</a>
							</li>
							<li>
		            	<a href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/answer/assignEditOther/id/<?php echo $at['ID']?>',800,600)" id="view_<?php echo $data->ID.'_'.$at['thread_number']?>">
												<i class=" icon-hand-down" ></i> Phân công editor khác
									</a>
							</li>
          	<?php } else { ?>
          	
          	<?php }?>      	
            </ul>
        </div>		
			</td>

		</tr>
		
		<?php }?>
